home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / qbhelp_2.arc / QBHELP.ASC next >
Text File  |  1988-01-16  |  4KB  |  113 lines

  1.  
  2.      ' Memory resident QB help program Alt-X activates
  3.      ' by Kauko J. Laurinolli  Dec. 2, 1987   404-981-9550
  4.      ' Assembly Subroutines  : Mach 2 V2.00 and Stay-res Plus from MicroHelp
  5.      ' Screens generated with: OSG   V1.05 from Inventories Unlimited
  6.      ' Compiled with QB4
  7.      ' BC qbhelp.asc/o;
  8.      ' LINK stayqb4+qbhelp+nocom+dispscr2,,nul,qbhelp.lib+mhlib2+bcom40 /E;
  9.  
  10.      defint a-z
  11.  
  12.      call get.monitor (last.monitor)                             'get monitor type
  13.  
  14.      scr.buffer$ = space$(16 * 1024 + 50)                        'space for screen image
  15.      kshift = varptr(scr.buffer$)                                'get segment address
  16.      call stayres( 3, kscan, kshift, ecode)                      'initiate
  17.  
  18.      kscan = 16 * 1024                                           'screen buffer inside basic
  19.      call stayres( 4, kscan, kshift, ecode)
  20.  
  21.      kscan = &h2D: kshift = 8: oper = 0
  22.      call MhScr("Programmers Help Loaded, use Alt-X to Activate", 0, csrlin, 1, 15)
  23.  
  24. HOT.KEY:
  25.      call stayres( oper, kscan, kshift, ecode)                   'go to sleep
  26.  
  27.      call get.monitor (monitor)                                  'check monitor type
  28.  
  29.      if last.monitor <> monitor then                             'change video mode
  30.           call stayres( 2, kscan, kshift, ecode)
  31.           last.monitor = monitor
  32.      end if
  33.  
  34.      call colr                                                   'show main screen
  35.      call ascii1                                                 'show 1st ascii table
  36.      curr.key = 1: mss$ = space$(10)
  37.  
  38.      CALL MhScr(" Programmers Help by K. Laurinolli    <Esc> <Esc> to Quit         PgUp  PgDn  ", 0, 25, 1, 78)
  39.      Old.Scan = 0                                                'clear old.scan
  40.  
  41. DO.SCAN:
  42.      shft = 0
  43.      call MhKclr(&h1600, 0, 1, 1, shift, scan, ascii)            'get curr.key
  44.  
  45.      if (shift and 1) = 1 then shft = shft + 1
  46.      if (shift and 2) = 2 then shft = shft + 2
  47.      if (shift and 4) = 4 then shft = shft + 4
  48.      if (shift and 8) = 8 then shft = shft + 8
  49.  
  50.      for col = 13 to 46 step 11
  51.           call mhscr(mss$, 0, 22, col, 51)                       'clear fields
  52.           call mhscr(mss$, 0, 23, col, 51)
  53.      next
  54.  
  55.      call mhscr(chr$(ascii), 0, 22, 17, 63)                      'char
  56.  
  57.      call mhscr(str$(ascii), 0, 22, 28, 63)                      'ascii
  58.      call mhscr(hex$(ascii), 0, 23, 29, 63)
  59.  
  60.      call mhscr(str$(shft), 0, 22, 39, 63)                       'shift
  61.      call mhscr(hex$(shft), 0, 23, 40, 63)
  62.  
  63.      call mhscr(str$(scan), 0, 22, 49, 63)                       'scan
  64.      call mhscr(hex$(scan), 0, 23, 50, 63)
  65.  
  66. REM  if scan = 2 then oper = 9: goto HOT.KEY                     'leave program, REM this when finished programming
  67.      if old.scan = scan and scan = 1 then goto hot.key           'go back to sleep after <Esc><Esc>
  68.  
  69.      if scan = 80 or scan = 81 or scan = 72 or scan = 73 then    'page ascii tables
  70.           if scan = 80 or scan = 81 then                         'page forward
  71.                if Curr.Key < 5 then
  72.                     Curr.Key = Curr.Key + 1
  73.                else
  74.                     Curr.Key = 1
  75.                end if
  76.           end if
  77.  
  78.           if scan = 72 or scan = 73 then                         'page backward
  79.                if Curr.Key > 1 then
  80.                     Curr.Key = Curr.Key - 1
  81.                else
  82.                     Curr.Key = 5
  83.                end if
  84.           end if
  85.  
  86.           if curr.key = 1 then call ascii1                       'show different ascii tables
  87.           if curr.key = 2 then call ascii2
  88.           if curr.key = 3 then call ascii3
  89.           if curr.key = 4 then call ascii4
  90.           if curr.key = 5 then call ascii5
  91.      end if
  92.  
  93.      Old.Scan = scan                                             'set old keyscan
  94.      goto do.scan
  95.  
  96.      END
  97.  
  98. SUB GET.MONITOR(MONITOR) STATIC
  99.  
  100.      call mhdisplay(mode,columns,rows,memory,display.type)
  101.  
  102.      if (display.type and 128)=128 then
  103.           monitor = &hB800                                       '&hB800 for color &hFFFF for no snow-check
  104.      else
  105.           monitor = &hB000                                       'mono
  106.      end if
  107.  
  108.      call mhvideo(monitor)
  109.      if monitor=&hB800 then call mhvideo(&hFFFF)                 'turn off snow checking on color monitors
  110.  
  111. end sub         'get.monitor mono / color
  112.  
  113.